/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EntityBeans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author DROWNE
 */
@Entity
@Table(name = "canuse")
@NamedQueries({
    @NamedQuery(name = "Canuse.findAll", query = "SELECT c FROM Canuse c"),
    @NamedQuery(name = "Canuse.findByIdcanuse", query = "SELECT c FROM Canuse c WHERE c.idcanuse = :idcanuse"),
    @NamedQuery(name = "Canuse.findByRechargetime", query = "SELECT c FROM Canuse c WHERE c.rechargetime = :rechargetime"),
    @NamedQuery(name = "Canuse.findByLimitPower", query = "SELECT c FROM Canuse c WHERE c.limitPower = :limitPower")})
public class Canuse implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idcanuse")
    private Integer idcanuse;
    @Column(name = "rechargetime")
    private Integer rechargetime;
    @Column(name = "limitPower")
    private Integer limitPower;
    @JoinColumn(name = "team_teamid", referencedColumnName = "idteam")
    @ManyToOne(optional = false)
    private Team team;
    @JoinColumn(name = "power_powerid", referencedColumnName = "idpower")
    @ManyToOne(optional = false)
    private Power power;

    public Canuse() {
    }

    public Canuse(Integer idcanuse) {
        this.idcanuse = idcanuse;
    }

    public Integer getIdcanuse() {
        return idcanuse;
    }

    public void setIdcanuse(Integer idcanuse) {
        this.idcanuse = idcanuse;
    }

    public Integer getRechargetime() {
        return rechargetime;
    }

    public void setRechargetime(Integer rechargetime) {
        this.rechargetime = rechargetime;
    }

    public Integer getLimitPower() {
        return limitPower;
    }

    public void setLimitPower(Integer limitPower) {
        this.limitPower = limitPower;
    }

    public Team getTeam() {
        return team;
    }

    public void setTeam(Team team) {
        this.team = team;
    }

    public Power getPower() {
        return power;
    }

    public void setPower(Power power) {
        this.power = power;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcanuse != null ? idcanuse.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Canuse)) {
            return false;
        }
        Canuse other = (Canuse) object;
        if ((this.idcanuse == null && other.idcanuse != null) || (this.idcanuse != null && !this.idcanuse.equals(other.idcanuse))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntityBeans.Canuse[idcanuse=" + idcanuse + "]";
    }

}
